#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
struct node 
{
	int x,y;
}dragon[1100];
bool cmp(node a,node b)
{
	if(a.x!=b.x) return a.x<b.x;
	else return a.y>b.y;
}
int main()
{
	int s,n;
	cin>>s>>n;
	for(int i = 0;i<n;i++)
	{
		cin>>dragon[i].x>>dragon[i].y;
	}
	sort(dragon,dragon+n,cmp);
	for(int i = 0;i<n;i++)
	{
		if(s>=dragon[i].x) s += dragon[i].y;
		else 
		{
			printf("NO\n");
			return 0;
		}
	}
	printf("YES\n");
	return 0;
} 
